*Paper: Fiscal Rules, Corruption and Electoral Accountability - Replication Files

clear all
cap log close 
set more off


**Global files
global folder "/Users/tommasogiommoni/Dropbox/Determinants of corruption/Stability pact and corruption/Replication files JOP"


********************************************************************************
****----						Dataset open 					    	----**** 
********************************************************************************

use "$folder/Data/dataset_feb2024.dta", clear

**-- Global

global controls7 proportion_female_Elected_lag av_education_Elected_lag av_age_Elected_lag  victory_margin_lag term_limit_lag 
global controls7_int  c.proportion_female_Elected_lag##i.anno c.av_education_Elected_lag##i.anno c.av_age_Elected_lag##i.anno c.victory_margin_lag##i.anno  c.term_limit_lag##i.anno

**-- Panel dataset

xtset codcom anno
fvset base 2012 anno

********************************************************************************
****----						Analysis 					    		----**** 
********************************************************************************

preserve
keep if anno==2012
keep if abs(P)<4000 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA")

 rddensity P, c(0) p(2) q(2) plot bwselect(diff) plot_ciuniform nohistogram graph_opt(graphregion(color(white)) legend(off) xlabel(-4000(500)4000,  angle(45)) ///
ylabel(0(0.0001)0.0005, angle(horizontal) labsize(small)) xtitle("Distance from 5,000 threshold (Reference population)") xline(0, lcolor(gs11)))
gr export "$folder/Figures/FigureA2_a.png" , replace 
sca h=e(h_l)
estadd scalar h=h
display h
local h_2=h*1.5
local h_3=h*2
sca p1=e(pv_q)   

 rddensity P, c(0) p(2) q(2) plot bwselect(diff) plot_ciuniform h(`h_2' `h_2') nohistogram graph_opt(graphregion(color(white)) legend(off) xlabel(-4000(500)4000,  angle(45)) ///
ylabel(0(0.0001)0.0005, angle(horizontal) labsize(small)) xtitle("Distance from 5,000 threshold (Reference population)") xline(0, lcolor(gs11)))
gr export "$folder/Figures/FigureA2_b.png" , replace 
sca p2=e(pv_q)  

 rddensity P, c(0) p(2) q(2) plot bwselect(diff) plot_ciuniform h(`h_3' `h_3') nohistogram graph_opt(graphregion(color(white)) legend(off) xlabel(-4000(500)4000,  angle(45)) ///
ylabel(0(0.0001)0.0005, angle(horizontal) labsize(small)) xtitle("Distance from 5,000 threshold (Reference population)") xline(0, lcolor(gs11)))
gr export "$folder/Figures/FigureA2_c.png" , replace 
sca p3=e(pv_q)  

 rddensity P, c(0) p(3) q(3) plot bwselect(diff) plot_ciuniform nohistogram graph_opt(graphregion(color(white)) legend(off) xlabel(-4000(500)4000,  angle(45)) ///
ylabel(0(0.0001)0.0005, angle(horizontal) labsize(small)) xtitle("Distance from 5,000 threshold (Reference population)") xline(0, lcolor(gs11)))
gr export "$folder/Figures/FigureA2_d.png" , replace 
sca p1=e(pv_q)  
restore

